
<?php 
class Con_menu extends Controller{
		function Con_menu(){
			parent::Controller();
			$this->load->model('m_menu');
		}
		
		function index(){
			
			$this->addmenu();	
		}
		
		function addmenu(){
			
			$data['menu'] = $this->m_menu->addmenu();
			if($data['menu']>0){
				redirect('backend_pages/allmenu/success/add');
			}else{
				echo "Can not insert";	
			}
		}
		
		//fun to delete , data from db .......
		function del_menu(){
		$id = $this->uri->segment(3);
			if((int)$id > 0){
				$oldrow = array('menu_id' => $id);
				$this->m_menu->delete_data($oldrow);
				redirect('backend_pages/allmenu/success/del');
			}   
		}
		
		// fun action update menu....=====
		function update_menu(){
			$data['menu'] = $this->m_menu->menu_up();	
			if($data['menu'] == true){
				redirect('backend_pages/allmenu/success/edit');
			}
		}
	}